//存储当前行商品信息的
//引入pinia
import { defineStore } from "pinia";
import { reactive, computed,ref } from "vue";

//通过 defineStore 创建的一个 store
export const userowDataStore = defineStore('rowData', () => {
  //一个异步函数，用于执行获取 API 请求
  const rowData = reactive({})
  const title=ref('添加')
  const changeRowData = (payload) => {
    Object.assign(rowData, payload)
  }
  const changetitle = (data) => {
    title.value=data
  }
  return { changeRowData,rowData,changetitle,title }
}, {
  persist: {
    storage: window.localStorage, // 可以使用 sessionStorage
  }
});